#ifndef _UTILEX_STRING_HPP_
#define _UTILEX_STRING_HPP_

#include <crt_util.h>

#ifdef __cplusplus


struct ChartoUcs2Struct
{
	static void* default_value()
	{
		return 0;
	}
	template<class _Ptr> static bool equal_to(_Ptr l, _Ptr r)
	{
		return l == r;
	}
	template<class _Ptr> static void destroy(_Ptr p)
	{
		if (p != NULL) {
			free(p);
		}
	}
};


static_inline int BasicString_Append_Char(basic_tstring &src ,const char *dst, size_t len) {

#if (TARGET_OS == OS_WINDOWS)
	{
		SafePtr<basic_tchar*, ChartoUcs2Struct> pBuf;
		pBuf = char_to_ucs2(dst, len);
		src += pBuf;
	}
#elif (TARGET_OS == OS_POSIX)
	src += dst;
#elif (TARGET_OS == OS_DARWIN)
	src += dst;
#endif 

	return S_SUCCESS;
}


#endif





#endif